package sg.edu.nus.iss.billing.parse;

import java.io.IOException;
import java.io.LineNumberReader;
import java.util.ArrayList;
import java.util.HashMap;
/**
 * @author sammil
 *
 */
public class TransactionAccountHeaderState extends ParserState {

	
	public static final TransactionAccountHeaderState SINGLETON = new TransactionAccountHeaderState();
	
	private TransactionAccountHeaderState(){
		
	}
	
	@Override
	public <L> ParserState parse(LineNumberReader in, HashMap<String,ArrayList<L>> outputMap)
			throws IOException {
		// TODO Auto-generated method stub
				
		if (!AccountHeaderParser.SINGLETON.parse(in, outputMap)) {

			throw createException("Expected Account header", in);
		}
		if (!SubscriptionHeaderParser.SINGLETON.parse(in, outputMap)) {

			throw createException("Expected Subscription header", in);
		}
		return TransactionHistoryState.SINGLETON;
		//return TransactionHeaderState.SINGLETON;
	}

}
